<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'menu-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><?php echo Yii::t('common', 'Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>
	
	<?php echo $form->hiddenField($model,'parent');?>
	<?php echo $form->hiddenField($model,'menu_id');?>

	<div class="row">
		<?php echo $form->labelEx($model,'active'); ?>
		<?php echo $form->dropDownList($model,'active', array('0'=>Yii::t('common','inactive'),'1'=>Yii::t('common','active'))); ?>
		<?php echo $form->error($model,'active'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'route'); ?>
		<?php echo $form->textField($model,'route',array('size'=>70,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'route'); ?>
	</div>

	<div class="row">
		<?php
		$tabs = array();
		$errors = array_keys($model->getErrors());

		$languages = Languages::model()->getLanguages();	
		foreach ($languages as $lang)
		{
			$errorTab = false;
			foreach ($errors as $error)
				if (substr($error,-3) == '_'.$lang['code'])
					$errorTab = true;
			$tabs[$lang['name']] = array(
				'content' => $this->renderPartial('_el_form_item', array('model'=>$model, 'lang'=>$lang['code'], 'form'=>$form), true),
				'id' => $lang['code'],
				'error' => $errorTab,
				);
		}
		$this->widget('application.extensions.MyCJuiTabs', array(
			'tabs' => $tabs,
			// additional javascript options for the tabs plugin
			'options'=>array(
	//			'collapsible'=>true,
			),
			'htmlOptions'=>array('class'=>'shadowtabs'),
		));
		?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? tt('Create') : tt('Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->